SWEP.base = "weapon_cs_base"
SWEP.Category = "Example";
SWEP.Author = "Stickmakerman";
SWEP.Contact = "nope";
SWEP.Purpose = "Tutorial";
SWEP.Instructions = "Example";
SWEP.PrintName = "Example SWep";
SWEP.Slot = 2;
SWEP.SlotPos = 5;
SWEP.DrawCrosshair = true;
SWEP.DrawAmmo = true;
SWEP.ViewModelFlip	= false;
SWEP.ViewModel = "models/v_9mmhandgun.mdl";
SWEP.WorldModel = "models/w_9mmhandgun.mdl";
SWEP.HoldType 	= "pistol";
SWEP.Spawnable 	= true;
SWEP.AdminSpawnable 	= true;
SWEP.AutoSwitchTo 	= false;
SWEP.AutoSwitchFrom 	= true;
SWEP.FiresUnderwater 	= false;

SWEP.Primary.ClipSize = 12;
SWEP.Primary.DefaultClip = 500;
SWEP.Primary.Recoil = 0.4;
SWEP.Primary.Damage = 6;
SWEP.Primary.NumberofShots = 1;
SWEP.Primary.Spread = 0.07;
SWEP.Primary.Delay = 0.2;
SWEP.Primary.Automatic = false;
SWEP.Primary.Ammo = "Pistol";
SWEP.Primary.Sound = "sound/weapons/pl_gun3.wav";
SWEP.Primary.Force = 1;
SWEP.Primary.TakeAmmo = 1;

SWEP.Secondary.ClipSize		= -1
SWEP.Secondary.DefaultClip	= -1
SWEP.Secondary.Automatic	= false
SWEP.Secondary.Ammo		= "none"

function SWEP:Precache()

    	util.PrecacheSound("sound/weapons/pl_gun3.wav")

end

function SWEP:PrimaryAttack()

   if ( !self:CanPrimaryAttack() ) then return end
   local bullet = {};
       bullet.Num = self.Primary.NumberofShots;
       bullet.Src = self.Owner:GetShootPos();
       bullet.Dir = self.Owner:GetAimVector();
       bullet.Spread = Vector( self.Primary.Spread * 0.1 , self.Primary.Spread * 0.1, 0);
       bullet.Tracer = 0;
       bullet.Force = self.Primary.Force;
       bullet.Damage = self.Primary.Damage;
       bullet.AmmoType = self.Primary.Ammo;
   local rnda = -self.Primary.Recoil;
   local rndb = self.Primary.Recoil * math.random(-1, 1);
   self:ShootEffects();
   self.Owner:FireBullets( bullet );
   self.Weapon:EmitSound(Sound(self.Primary.Sound))
   self.Owner:ViewPunch( Angle( rnda,rndb,rnda ) )
   self:TakePrimaryAmmo(self.Primary.TakeAmmo)
   self.Weapon:SetNextPrimaryFire( CurTime() + self.Primary.Delay )

end